using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_Base_UserMap : EntityTypeConfiguration<t_Base_User>
    {
        public t_Base_UserMap()
        {
            // Primary Key
            this.HasKey(t => t.FUserID);

            // Properties
            this.Property(t => t.FUserID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FSID)
                .HasMaxLength(255);

            this.Property(t => t.FDescription)
                .HasMaxLength(255);

            this.Property(t => t.FSSOUsername)
                .HasMaxLength(255);

            this.Property(t => t.FSCPwd)
                .HasMaxLength(32);

            this.Property(t => t.FModifyTime)
                .IsFixedLength()
                .HasMaxLength(8)
                .IsRowVersion();

            this.Property(t => t.FPortUser)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("t_Base_User");
            this.Property(t => t.FUserID).HasColumnName("FUserID");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FSID).HasColumnName("FSID");
            this.Property(t => t.FPrimaryGroup).HasColumnName("FPrimaryGroup");
            this.Property(t => t.FDescription).HasColumnName("FDescription");
            this.Property(t => t.FForbidden).HasColumnName("FForbidden");
            this.Property(t => t.FRight).HasColumnName("FRight");
            this.Property(t => t.FEmpID).HasColumnName("FEmpID");
            this.Property(t => t.FDataVokeType).HasColumnName("FDataVokeType");
            this.Property(t => t.FIsNeedOffline).HasColumnName("FIsNeedOffline");
            this.Property(t => t.FRightChanged).HasColumnName("FRightChanged");
            this.Property(t => t.FOfflineRefeshEachTime).HasColumnName("FOfflineRefeshEachTime");
            this.Property(t => t.FSafeMode).HasColumnName("FSafeMode");
            this.Property(t => t.FHRUser).HasColumnName("FHRUser");
            this.Property(t => t.FSSOUsername).HasColumnName("FSSOUsername");
            this.Property(t => t.FSCPwd).HasColumnName("FSCPwd");
            this.Property(t => t.UUID).HasColumnName("UUID");
            this.Property(t => t.FModifyTime).HasColumnName("FModifyTime");
            this.Property(t => t.FAccessUUID).HasColumnName("FAccessUUID");
            this.Property(t => t.FUInValidDate).HasColumnName("FUInValidDate");
            this.Property(t => t.FPwCreateDate).HasColumnName("FPwCreateDate");
            this.Property(t => t.FPwValidDay).HasColumnName("FPwValidDay");
            this.Property(t => t.FAuthRight).HasColumnName("FAuthRight");
            this.Property(t => t.FUserTypeID).HasColumnName("FUserTypeID");
            this.Property(t => t.FPortUser).HasColumnName("FPortUser");
        }
    }
}
